<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // 创建管理员
        User::factory()->admin()->create([
            'name' => 'admin',
            'email' => 'admin@tieba.com',
            'phone' => '13800000001',
            'password' => Hash::make('password'),
            'nickname' => '系统管理员',
            'exp' => 5000,
        ]);

        // 创建几个测试用户
        User::factory()->withPhone('13800000002')->create([
            'name' => 'testuser1',
            'email' => 'test1@tieba.com',
            'password' => Hash::make('password'),
            'nickname' => '测试用户1',
            'signature' => '这是一个测试用户的签名',
            'exp' => 150,
        ]);

        User::factory()->withPhone('13800000003')->create([
            'name' => 'testuser2',
            'email' => 'test2@tieba.com',
            'password' => Hash::make('password'),
            'nickname' => '测试用户2',
            'exp' => 80,
        ]);

        // 创建更多随机用户
        User::factory(3)->withPhone()->experienced()->create();
        User::factory(5)->create();
    }
}
